<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$eventTable = new BAEventSheet();

$eventView = $eventTable->getView();
?>
<table class="table table-hover">
    <thead>
        <tr>
            <th><input type="checkbox" name="checkAll_2" id="checkAll_2"></th>
            <th>活动名称</th>
            <th>活动类型</th>
            <th>活动描述</th>
            <th>操作</th>
        </tr> 
    </thead>
    <tbody>
        <?php
        foreach ($eventView as $eventId => $event) {
            $manageViewItem = $event->getItem('manageView');
            if ($manageViewItem) {
                ?>
                <tr>
                    <td><label class="checkbox">
                            <input type="checkbox" name="subBox[]" value="<?php echo $event->id; ?>"> 
                        </label></td>
                    <td> <?php echo $event->getItem('name')->getValue(); ?> </td>
                    <td> <?php
                        $eventTypeId = $event->getItem('eventTypeId')->getValue();
                        $eventType = new BACategory($eventTypeId);
                        echo $eventType->name;
                        ?> 
                    </td>
                    <td> <?php echo $event->getItem('description')->getValue(); ?> </td>
                    <td>
                        <div class="row-fluid">
                            <?php
                            echo $control->getAjaxLink(array('name' => '管理', 'id' => 'manageEvent'), array('eventId' => $eventId));
                            ?>
                        </div>                   
                    </td>
                </tr>
            <?php }
        } ?>
    </tbody>
</table>

